<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;
//登录路由
Route::post('/login','login/index')->middleware([\app\middleware\Login::class]);
Route::get('/admin/token', 'admin/token');
//->middleware([\app\middleware\Token::class])
//把需要验证权限的路由放一起
Route::get('/traceability/exlToSql', 'traceability/exlToSql');

Route::group('/', function(){
    //管理员路由
    Route::get('/admin/getlist', 'admin/getlist')->middleware([\app\middleware\CheckList::class]);
    Route::post('/admin/insert', 'admin/insert');
    Route::put('/admin/update', 'admin/update')->middleware([\app\middleware\Check_id::class]);
    Route::delete('/admin/delete', 'admin/delete')->middleware([\app\middleware\Check_id::class]);
    Route::get('/admin/info', 'admin/info')->middleware([\app\middleware\Check_id::class]);
    //菜单路由
    Route::get('/menu/getlist', 'menu/getlist');
    Route::post('/menu/insert', 'menu/insert');
    Route::put('/menu/update', 'menu/update')->middleware([\app\middleware\Check_id::class]);
    Route::delete('/menu/dele', 'menu/delete')->middleware([\app\middleware\Check_id::class]);
    Route::get('/menu/info', 'menu/info')->middleware([\app\middleware\Check_id::class]);
    //角色路由
    Route::get('/role/getlist', 'role/getlist')->middleware([\app\middleware\CheckList::class]);
    Route::post('/role/insert', 'role/insert');
    Route::put('/role/update', 'role/update')->middleware([\app\middleware\Check_id::class]);
    Route::delete('/role/delete', 'role/delete')->middleware([\app\middleware\Check_id::class]);
    Route::get('/role/info', 'role/info')->middleware([\app\middleware\Check_id::class]);

    //分类管理
    Route::get('/product_type/getlist', 'product_type/getlist');
    Route::post('/product_type/insert', 'product_type/insert');
    Route::put('/product_type/update', 'product_type/update')->middleware([\app\middleware\Check_id::class]);
    Route::delete('/product_type/dele', 'product_type/delete')->middleware([\app\middleware\Check_id::class]);
    Route::get('/product_type/info', 'product_type/info')->middleware([\app\middleware\Check_id::class]);
    Route::get('/product_type/getSeleList', 'product_type/getSeleList');


    //企业管理
    Route::get('/company/getlist', 'company/getlist');
    Route::post('/company/insert', 'company/insert');
    Route::put('/company/update', 'company/update')->middleware([\app\middleware\Check_id::class]);
    Route::delete('/company/dele', 'company/dele')->middleware([\app\middleware\Check_id::class]);
    Route::get('/company/info', 'company/info')->middleware([\app\middleware\Check_id::class]);
    Route::put('/company/updateStatus', 'company/updateStatus')->middleware([\app\middleware\Check_id::class]);
    Route::get('/company/getSeleList', 'company/getSeleList');

    //文件上传与查看
    Route::post('/upload/uploadLogo', 'upload/uploadLogo');
    Route::post('/upload/uploadImgs', 'upload/uploadImgs');
    Route::post('/upload/uploadFiles', 'upload/uploadFiles');

    //企业品牌管理
    Route::get('/Product/getlist', 'Product/getlist');
    Route::post('/Product/insert', 'Product/insert');
    Route::put('/Product/update', 'Product/update')->middleware([\app\middleware\Check_id::class]);
    Route::delete('/Product/dele', 'Product/dele')->middleware([\app\middleware\Check_id::class]);
    Route::get('/Product/info', 'Product/info')->middleware([\app\middleware\Check_id::class]);
    Route::put('/Product/updateStatus', 'Product/updateStatus')->middleware([\app\middleware\Check_id::class]);
    Route::get('/Product/getSeleList', 'Product/getSeleList');

    //工艺管理
    Route::get('/Process/getlist', 'Process/getlist');
    Route::post('/Process/insert', 'Process/insert');
    Route::put('/Process/update', 'Process/update')->middleware([\app\middleware\Check_id::class]);
    Route::delete('/Process/dele', 'Process/dele')->middleware([\app\middleware\Check_id::class]);
    Route::get('/Process/info', 'Process/info')->middleware([\app\middleware\Check_id::class]);
    Route::put('/Process/updateStatus', 'Process/updateStatus')->middleware([\app\middleware\Check_id::class]);

    //分级分类
    Route::get('/Grade/getlist', 'Grade/getlist');
    Route::get('/Grade/getSeleList', 'Grade/getSeleList');
    Route::post('/Grade/insert', 'Grade/insert');
    Route::put('/Grade/update', 'Grade/update')->middleware([\app\middleware\Check_id::class]);
    Route::delete('/Grade/dele', 'Grade/dele')->middleware([\app\middleware\Check_id::class]);
    Route::get('/Grade/info', 'Grade/info')->middleware([\app\middleware\Check_id::class]);
    Route::put('/Grade/updateStatus', 'Grade/updateStatus')->middleware([\app\middleware\Check_id::class]);

    //特色分级
    Route::get('/flavour/getlist', 'flavour/getlist');
    Route::get('/flavour/getSeleList', 'flavour/getSeleList');
    Route::post('/flavour/insert', 'flavour/insert');
    Route::put('/flavour/update', 'flavour/update')->middleware([\app\middleware\Check_id::class]);
    Route::delete('/flavour/dele', 'flavour/dele')->middleware([\app\middleware\Check_id::class]);
    Route::get('/flavour/info', 'flavour/info')->middleware([\app\middleware\Check_id::class]);
    Route::put('/flavour/updateStatus', 'flavour/updateStatus')->middleware([\app\middleware\Check_id::class]);

    //地理标志——保护产品信息landmark
    Route::get('/landmark_protect/getlist', 'landmark_protect/getlist');
    Route::get('/landmark_protect/getSeleList', 'landmark_protect/getSeleList');
    Route::post('/landmark_protect/insert', 'landmark_protect/insert');
    Route::put('/landmark_protect/update', 'landmark_protect/update')->middleware([\app\middleware\Check_id::class]);
    Route::delete('/landmark_protect/dele', 'landmark_protect/dele')->middleware([\app\middleware\Check_id::class]);
    Route::get('/landmark_protect/info', 'landmark_protect/info')->middleware([\app\middleware\Check_id::class]);
    Route::put('/landmark_protect/updateStatus', 'landmark_protect/updateStatus')->middleware([\app\middleware\Check_id::class]);

    //地理标志——商标信息
    Route::get('/landmark_trademark/getlist', 'landmark_trademark/getlist');
    Route::get('/landmark_trademark/getSeleList', 'landmark_trademark/getSeleList');
    Route::post('/landmark_trademark/insert', 'landmark_trademark/insert');
    Route::put('/landmark_trademark/update', 'landmark_trademark/update')->middleware([\app\middleware\Check_id::class]);
    Route::delete('/landmark_trademark/dele', 'landmark_trademark/dele')->middleware([\app\middleware\Check_id::class]);
    Route::get('/landmark_trademark/info', 'landmark_trademark/info')->middleware([\app\middleware\Check_id::class]);
    Route::put('/landmark_trademark/updateStatus', 'landmark_trademark/updateStatus')->middleware([\app\middleware\Check_id::class]);

    //地理标志——商标信息
    Route::get('/landmark_fruit/getlist', 'landmark_fruit/getlist');
    Route::get('/landmark_fruit/getSeleList', 'landmark_fruit/getSeleList');
    Route::post('/landmark_fruit/insert', 'landmark_fruit/insert');
    Route::put('/landmark_fruit/update', 'landmark_fruit/update')->middleware([\app\middleware\Check_id::class]);
    Route::delete('/landmark_fruit/dele', 'landmark_fruit/dele')->middleware([\app\middleware\Check_id::class]);
    Route::get('/landmark_fruit/info', 'landmark_fruit/info')->middleware([\app\middleware\Check_id::class]);
    Route::put('/landmark_fruit/updateStatus', 'landmark_fruit/updateStatus')->middleware([\app\middleware\Check_id::class]);

    //企业审核
    Route::get('/CompanyCheck/getlist', 'CompanyCheck/getlist');
    Route::put('/CompanyCheck/check', 'CompanyCheck/check')->middleware([\app\middleware\Check_id::class]);

    //检测检验
    Route::get('/proof/getlist', 'proof/getlist');
    Route::post('/proof/insert', 'proof/insert');
    Route::put('/proof/update', 'proof/update')->middleware([\app\middleware\Check_id::class]);
    Route::delete('/proof/dele', 'proof/dele')->middleware([\app\middleware\Check_id::class]);
    Route::get('/proof/info', 'proof/info')->middleware([\app\middleware\Check_id::class]);
    Route::put('/proof/updateStatus', 'proof/updateStatus')->middleware([\app\middleware\Check_id::class]);

    //批次管理
    Route::get('/batch/getlist', 'batch/getlist');
    Route::post('/batch/insert', 'batch/insert');
    Route::get('/batch/getOldlist', 'batch/getOldlist');
    Route::put('/batch/update', 'batch/update')->middleware([\app\middleware\Check_id::class]);
    Route::delete('/batch/dele', 'batch/dele')->middleware([\app\middleware\Check_id::class]);
    Route::get('/batch/info', 'batch/info')->middleware([\app\middleware\Check_id::class]);
    Route::put('/batch/updateStatus', 'batch/updateStatus')->middleware([\app\middleware\Check_id::class]);

    //溯源管理
    Route::get('/traceability/getlist', 'traceability/getlist');
//    Route::post('/traceability/insert', 'traceability/insert');
    Route::get('/traceability/downloadXlsx', 'traceability/downloadXlsx');
    Route::post('/traceability/uploadXlsx', 'traceability/uploadXlsx');
    Route::get('/traceability/getBatchList', 'traceability/getBatchList');
    Route::delete('/traceability/dele', 'traceability/dele')->middleware([\app\middleware\Check_id::class]);
    Route::get('/traceability/info', 'traceability/info')->middleware([\app\middleware\Check_id::class]);
    Route::put('/traceability/updateStatus', 'traceability/updateStatus')->middleware([\app\middleware\Check_id::class]);

    //产品保险管理
    Route::get('/Insure/getlist', 'Insure/getlist');
    Route::post('/Insure/insert', 'Insure/insert');
    Route::put('/Insure/update', 'Insure/update')->middleware([\app\middleware\Check_id::class]);
    Route::delete('/Insure/dele', 'Insure/dele')->middleware([\app\middleware\Check_id::class]);
    Route::get('/Insure/info', 'Insure/info')->middleware([\app\middleware\Check_id::class]);
    Route::put('/Insure/updateStatus', 'Insure/updateStatus')->middleware([\app\middleware\Check_id::class]);



})->middleware(\app\middleware\Token::class);

Route::get('/traceability/insert', 'traceability/insert');